#include<iostream>
#include"Vector.hpp"

using namespace std;

inline void Vecprint(Vector<int> & a){
    for(int i=0;i<a.size();i++)
    cout<<a[i]<<' ';
    cout<<endl;
}
int main(){
    int n,x,y;

    cout<<"Test1: Vector construction: "<<endl;
    Vector<int> a;
    Vector<int> b;
    cout<<"Enter the size of vector b: "<<endl;
    cin>>n;
    cout<<"Enter the elements of b: "<<endl;
    for(int i=0;i<n;i++) { cin>>x; b.push_back(x);}
    Vector<int> c=b;
    cout<<"Vector a: "<<endl; Vecprint(a);
    cout<<"Vector b: "<<endl; Vecprint(b);
    cout<<"Vector c: "<<endl; Vecprint(c);

    cout<<"Test2: Modifying in a vector: "<<endl;
    for(int i=0;i<c.size();i++) c[i]=c[i]*2+1;
    Vecprint(c);

    cout<<"Test3: Pop_back in a vector: "<<endl;
    cout<<"Enter the number of times of pop_back: "<<endl;
    cin>> n;
    for(int i=0;i<n;i++){
        cout<<"Pop "<<i+1<<"time(s) from the back of b: "<<endl;
        b.pop_back();
        Vecprint(b);
    }

    cout<<"Test3: Iterator in a vector: "<<endl;
    for(Vector<int>:: iterator it =b.begin();it !=b.end(); it++){
        cout<<*it<<endl;
    }
}